
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.TextField;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Mr Bao
 */
public class Timkiem extends Form implements CommandListener {

    private UpAnh upAnh;
    private Command cmdTimkiem;
    private TextField txtTimkiem;

    public Timkiem(UpAnh upAnh) {
        super("Tim kiem");
        this.upAnh = upAnh;
        txtTimkiem = new TextField("Tu khoa", null, 50, TextField.ANY);
        this.append(txtTimkiem);
        cmdTimkiem = new Command("Timkiem", Command.OK, 2);
        this.addCommand(cmdTimkiem);
        this.setCommandListener(this);
    }

    public void commandAction(Command c, Displayable d) {
        if (c == cmdTimkiem) {
            upAnh.client.Timkiem(txtTimkiem.getString());
            upAnh.DisplayViewImageNameNew();
        }
    }
}
